package com.seanchenxi.gwt.wordpress.xmlrpc.service.model.impl;

import java.util.HashMap;

import com.seanchenxi.gwt.wordpress.domain.model.Post;
import com.seanchenxi.gwt.wordpress.domain.model.PostStatus;

public class PostImpl extends ContentImpl implements Post {

	/**
	 * Generated id
	 */
	private static final long serialVersionUID = -1558758683921809514L;
	final static String STICKY = "sticky";
	final static String POST_STATUS = "post_status";

	public PostImpl() {
		super();
		set(POST_TYPE, "post");
	}

	public PostImpl(HashMap<String, Object> properties) {
		super(properties);
		set(POST_TYPE, "post");
	}

	@Override
	public boolean isSticky() {
		if (get(STICKY) == null)
			return false;
		return get(STICKY);
	}

	@Override
	public void setSticky(boolean isSticky) {
		set(STICKY, isSticky);
	}

	@Override
	public PostStatus getPostStatus() {
		return get(POST_STATUS);
	}

	@Override
	public void setPostStatus(PostStatus page_status) {
		set(POST_STATUS, page_status);
	}

}
